package com.gsnd.gsnd22estore.service.impl;

import com.gsnd.gsnd22estore.domain.EsBook;
import com.gsnd.gsnd22estore.domain.EsShopcar;
import com.gsnd.gsnd22estore.dto.ShopCarInfoDTO;
import com.gsnd.gsnd22estore.exception.BookStoreException;
import com.gsnd.gsnd22estore.mapper.EsBookMapper;
import com.gsnd.gsnd22estore.mapper.EsShopcarMapper;
import com.gsnd.gsnd22estore.service.ShopCarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.servlet.HandlerInterceptor;

import java.util.List;

@Service
public class ShopCarServiceImpl implements ShopCarService {


        @Autowired
        EsShopcarMapper shopcarMapper;

        @Override
        public List<ShopCarInfoDTO> getShopCarByUser(Integer userId) {
            return shopcarMapper.getShopCarInfoByUse(userId);
        }

        @Override
        public void removeShopCar(List<Integer> ids) {
            shopcarMapper.removeShopCar(ids);
        }

        @Override
        public void addBookToShopCar(EsShopcar shopCar) {
            shopcarMapper.addBookToShopCar(shopCar);
        }

        @Override
        public void exitBookNum(EsShopcar shopCar) {
            shopcarMapper.exitBookNum(shopCar);
        }
    }

//添加购物车

